#第一题
s = "Hello, welcome to my world."
count = 0
for char in s:
    if char == 'w':
        count += 1
print("字母 'w' 在字符串中出现了 {} 次".format(count))

#第二题
import pandas as pd
# print(df[0:3]) 获取行, 获取列 (省略写法)
df = pd.DataFrame(data=[['战狼2','丁一',6,8],
                       ['攀登者','王二',8,6],
                       ['攀登者','张三',10,8],
                       ['卧虎藏龙','李四',8,8],
                       ['卧虎藏龙','赵五',8,10]],
                  columns=['电影名称','影评师','观前评分','观后评分'])

result=df.groupby('电影名称')[['观前评分', '观后评分']].mean()
print(result)
